package com.gongj.secuity.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gongj.secuity.service.HelloService;

@RestController
public class HelloController {

    @GetMapping("/he")
    public String he() {
        return "hello Security";
    }

    @GetMapping("/admin/he")
    public String admin() {
        return "hello admin";
    }

    @GetMapping("/user/he")
    public String user() {
        return "hello user";
    }

    @GetMapping("/db/he")
    public String db() {
        return "hello db";
    }

    @GetMapping("/login1")
    public String login1() {
        return "hello login1";
    }


    @Autowired
    HelloService helloService;

    @GetMapping("/helloAdmin")
    public String helloAdmin() {
        return helloService.admin();
    }

    @GetMapping("/helloUser")
    public String helloUser() {
        return helloService.user();
    }

    @GetMapping("/hellodb")
    public String hellodb() {
        return helloService.db();
    }
}
